feat(trace): add agk trace watch to live-tail a run#21
Open
kunalkushwaha wants to merge 1 commit into
Open
Conversation
Streams each span as it is appended to trace.jsonl — a lightweight, scriptable counterpart to the hot-reloading `trace show` TUI. Pairs with `agk run` (run in one terminal, watch in another). - With no run ID, follows the live run if one is running, otherwise waits for the next run to start; ends when the run completes (manifest.json) or on Ctrl+C. - Per-span line with icons (agent/LLM/tool/workflow) + duration; prints a final summary and a `trace view` hint on completion. - traceTailer reads only newly-appended complete lines, buffering partial lines. Tests: tailer offset/partial-line handling, span formatting, icons/truncation. Verified end-to-end against a simulated live run (spans streamed, completion detected, clean exit). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
agk trace watch— a lightweight, scriptable live-tail of a run's spans as they execute. It's thetail -fcounterpart to the hot-reloadingtrace showTUI, and pairs naturally withagk run: run the agent in one terminal, watch the trace populate in another.This is feature B5 (watch) from the
FEATURES.mdroadmap.Behavior
agk run).manifest.jsonis written) or on Ctrl+C.trace viewhint on completion.traceTailerreads only newly-appended complete lines, buffering any trailing partial line (so it never prints a half-written JSON record).Testing
go build,go vet,go test ./...,gofmtall green.watchstreamed each span and exited cleanly on completion.🤖 Generated with Claude Code